//
//  EZScoketPacket.swift
//  QuicDemo
//
//  Created by ellzu gu on 2021/6/29.
//

import Foundation

extension EZSocket {
    public class Packet  {
        var data : Data;
        var timeoutInterval : TimeInterval;
        var completion : (EZError?)->Void;
        var position : Int = 0;
        var beginTime : TimeInterval;
        var targetAddress: sockaddr_storage? = nil
        init(data : Data, timeout : TimeInterval, completion: @escaping (EZError?)->Void) {
            self.data = data;
            self.timeoutInterval = timeout;
            self.completion = completion;
            self.beginTime = Date.init().timeIntervalSince1970;
        }
    }
}
